<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
	#box{
		width: 600px;
		height: 500px;
		border: 4px solid blue;
		margin: 10px auto;
		position: relative;
	}
	#box .msg{
		width: 200px;
		height: 150px;
		background: purple;
		position: absolute;
		top: 71px;
		left: 123px;
		z-index: 2;
	}
	#box .msg2{
		width: 300px;
		height: 150px;
		background: green;
		position: absolute;
		left: 200px;
		top: 150px;
		z-index: 3;
	}
</style>
</head>

<body>

<!-- 有定位属性的元素绝不带在同一层级 -->
<!-- 有定位属性的元素默认层级值为0，但是层级值一样后来者居上 -->
<!-- 只有有定位属性的元素才有层级之说 -->

<div id="box">
	<div class="msg"></div>
	<div class="msg2"></div>
</div>



</body>
</html>
